package org.pan.domain.db;

import org.pan.domain.DomainObject;
import org.pan.domain.enums.CardUserStateEnum;

import javax.persistence.*;
import java.util.Date;

/**
 * 用户状态变更记录
 *
 * Created by panmingzhi on 2015/12/25.
 */
@Entity
public class CardUserStateRecord extends DomainObject {

	public enum Property{
		id,cardUser,cardUserStateEnum,createTime
	}

	@ManyToOne
	@JoinColumn(name="cardUser")
	private CardUser cardUser;

	@Column
	@Enumerated(value = EnumType.STRING)
	private CardUserStateEnum cardUserStateEnum;

	@Column
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;

	@PrePersist
	public void prePersist(){
		this.createTime = new Date();
	}

	public CardUser getCardUser() {
		return cardUser;
	}

	public void setCardUser(CardUser cardUser) {
		this.cardUser = cardUser;
	}

	public CardUserStateEnum getCardUserStateEnum() {
		return cardUserStateEnum;
	}

	public void setCardUserStateEnum(CardUserStateEnum cardUserStateEnum) {
		this.cardUserStateEnum = cardUserStateEnum;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


}
